#ifndef __GlFireworksEffect_h__
#define __GlFireworksEffect_h__

#include <deque>
#include "GlEffect.h"
#include "GlPosition.h"

namespace GraphicLibrary
{
	class Sprite;

	class GlExport FireworksEffect
		: public Effect
	{
		public:
			FireworksEffect(const float timeBetweenExplosions);
			virtual ~FireworksEffect();
			virtual bool tick(const float deltaTime);
		private:
			class GlExport Particle
			{
				public:
					Particle(const Position pos);
					~Particle();
					virtual bool tick(const float deltaTime);
				private:
					float		mDirection;
					float		mSpeed;
					float		mDuration;
					float		mTime;
					Position	mPos;
					Sprite*		mSprite;
			};
			typedef std::deque<Particle*>	ParticleArray;
			ParticleArray	mParticles;
			float			mTime;
			const float		mTimeBetweenExplosions;

			void createExplosion();
	};
}

#endif // __GlFireworksEffect_h__
